﻿using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SharpCommon.Data;
using SharpCommon.Extension;

namespace Test
{
    [TestClass]
    public class DataTableExtensionTest
    {
        [TestMethod]
        public void GenerateInfos()
        {
            string strSQL = "select * from Person";
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            DataTable dataTable = DataBaseContext.DBInstance.ExecuteDataTable(strSQL);
            IList<Person> actual = dataTable.GenerateInfos<Person>();
            stopwatch.Stop();
            Assert.Inconclusive(stopwatch.ElapsedMilliseconds.ToString());
            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.Count > 0);
        }
    }
}
